﻿/**
 * 
 */
package com.zit.presentation.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.json.JSONException;
import org.apache.struts2.json.JSONUtil;

import com.zit.entity.Dorm;
import com.zit.service.BedroomService;
import com.zit.service.DormService;

public class BedroomAction extends BaseAction {
	
	//公寓编号
	private int did;
	
	//返回所有寝室json字符串
	private String jsonBd;
	
	//实例化BedroomService
	private BedroomService bedroomService=new BedroomService();
	
	/**
	 * 作者：唐美兰
	 * 功能：查询该公寓下的所有寝室
	 * @return
	 * @throws JSONException 
	 */
	public String selectBd() throws JSONException{
		jsonBd=JSONUtil.serialize(bedroomService.select(did));
		return "selectBd";
	}

	public int getDid() {
		return did;
	}

	public void setDid(int did) {
		this.did = did;
	}

	public String getJsonBd() {
		return jsonBd;
	}

	public void setJsonBd(String jsonBd) {
		this.jsonBd = jsonBd;
	}
	
}

